﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using KPIS.GERP.GHRMS.DAL;
using KPIS.GERP.GHRMS.MODEL;

namespace KPIS.GERP.GHRMS.BLL
{
    public class EssMessageBLL
    {
        private static readonly EssMessageDAL dal = new EssMessageDAL();

        public string GetNextSendRefNo(string SendType)
        {
            return dal.GetNextSendRefNo(SendType);
        }
        public void Send(Nullable<int> FromEmpSequence, Nullable<int> ToEmpSequence,  Nullable<DateTime> SendDate, string SendText
            , Nullable<int> RefSequence, int CreatedBy)
        {
            EssMessageInfo sendInfo = new EssMessageInfo();

            sendInfo.SendDate = SendDate;
            sendInfo.SendText = SendText;
            sendInfo.RefType = "notice";
            sendInfo.MessageStatus = "0";
            sendInfo.RefSequence = RefSequence;
            sendInfo.FromSequence = FromEmpSequence;
            sendInfo.ToSequence = ToEmpSequence;
            sendInfo.CreatedBy = CreatedBy;

            dal.Send(sendInfo);
        }
    }
}
